package hong.jun.controller;

import hong.jun.domain.course;
import hong.jun.mapper.CourseMapper;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CourseController {
    @Autowired
    private CourseMapper mapper;

    @GetMapping(value = "course/{id}")
    public String landbyid(@PathVariable("id") long id) {
        //System.out.println("-------------"+id);
        course course = mapper.landbyid(id);
        //System.out.println("************"+course);
        return course.toString();
    }
}
